import React, { Component } from 'react';
import './App.css';
import axios from 'axios';
class App extends Component{
  handleClick = () => {
    axios.get('/server1/students').then(res => {
      console.log(res);
    }).catch(err => {
      console.log(err)
    });
  }
  handleClick2 = () => {
    axios.get('/server2/cars').then(res => {
      console.log(res);
    }).catch(err => {
      console.log(err)
    });
  }
  render(){
    return (
      <div className="App">
        App...
        <button onClick={this.handleClick}>获取学生数据</button>
        <button onClick={this.handleClick2}>获取汽车数据</button>
      </div>
    )
  } 
}

export default App;
